﻿using FlickrXplorer.Web.Objects;

namespace FlickrXplorer.Web.Plugin
{
  /// <summary>
  /// Holds information relating to the FlickrXplorer sidebar.
  /// </summary>
  /// <value>
  /// This holds the list of photos that are loaded into the
  /// thumbnail control on the sidebar. <see cref="FlickrXplorer.Web.Plugin.LoadSidebarEventArgs.Content" text="Content" />
  /// will appear above the Popular Tags box. 
  /// </value>                                                                                                             
  public class LoadSidebarEventArgs : PluginEventArgs
  {
    /// <summary>
    /// The list of photos that are related to the main photo.
    /// 
    /// 
    /// </summary>                                            
    public PhotoData PhotoData { get; private set; }
    /// <summary>
    /// Gets or sets the content to be displayed in the sidebar.
    /// </summary>
    /// Note
    /// This property will not return the rendered content as
    /// combined with the <see cref="FlickrXplorer.Web.Plugin.ContentSection.Template" text="Template" />.
    public override string Content
    {
      get { return this.contentSection.Content; }
      set { this.contentSection.Content = value; }
    }

    /// <summary>
    /// Creates a new instance of the <see cref="FlickrXplorer.Web.Plugin.LoadSidebarEventArgs" text="LoadSidebarEventArgs Class" />.
    /// </summary>
    /// <param name="contentManager">The active ContentManager.</param>
    /// <param name="photoData">The list of photos.</param>                                                                          
    public LoadSidebarEventArgs(ContentSection contentSection, PhotoData photoData)
      : base(contentSection)
    {
      this.PhotoData = photoData;
    }
  }
}
